/*
 * 描          述:  <描述>
 * 修  改   人:  PengQingyang
 * 修改时间:  2012-11-5
 * <修改描述:>
 */
package com.tx.core.paged.model.impl;

import java.io.Serializable;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.tx.core.paged.model.PagedList;

/**
 * 分页对象<br/>
 *    由于之前项目中一直在延用，新版本不进行调整<br/>
 *    由于pagedlist在实现中需要兼容历史版本list字段在历史版本中有所使用
 *    同时向页面返回list,records对传输有所消耗
 *    如果在新开项目中，建议通过Databinder将该实现的返回json通过定义屏蔽掉list的字段
 * @author PengQingyang
 * @version [版本号, 2012-11-5]
 * @see [相关类/方法]
 * @since [产品/模块版本]
 */
@JsonAutoDetect
public class PagedListImpl<T> extends Page<T>
        implements PagedList<T>, Serializable {
    
    /** 注释内容 */
    private static final long serialVersionUID = -1428503320236516181L;
    
    public PagedListImpl() {
    }
    
    public PagedListImpl(long current, long size) {
        this(current, size, 0);
    }
    
    public PagedListImpl(long current, long size, long total) {
        this(current, size, total, true);
    }
    
    public PagedListImpl(long current, long size, boolean searchCount) {
        this(current, size, 0, searchCount);
    }
    
    public PagedListImpl(long current, long size, long total,
            boolean searchCount) {
        super(current, size, total, searchCount);
    }
    
    /* --------------- 以下为静态构造方式 --------------- */
    public static <T> PagedListImpl<T> of(long current, long size) {
        return of(current, size, 0);
    }
    
    public static <T> PagedListImpl<T> of(long current, long size, long total) {
        return of(current, size, total, true);
    }
    
    public static <T> PagedListImpl<T> of(long current, long size,
            boolean searchCount) {
        return of(current, size, 0, searchCount);
    }
    
    public static <T> PagedListImpl<T> of(long current, long size, long total,
            boolean searchCount) {
        return new PagedListImpl<T>(current, size, total, searchCount);
    }
    
}
